﻿using System;

namespace ADEVSO.Collections
{
    public class ArrayList : System.Collections.ArrayList
    {
        #region Contructors

        /// <summary>
        /// Create New ArrayList
        /// </summary>
        public ArrayList() 
            : base()
        {
        }

        /// <summary>
        /// Create New ArrayList
        /// </summary>
        /// <param name="size">Initial ArrayList Size</param>
        public ArrayList(int size)
            : base(size)
        {
        }

        #endregion

        #region Methods

        /// <summary>
        /// Convert ArrayList to String Array
        /// </summary>
        /// <returns></returns>
        public String[] ToStringArray()
        {
            String[] rArray = new String[Count];
            for (int i = 0; i < Count; i++)
                rArray[i] = this[i].ToString();
            return rArray;
        }

        /// <summary>
        /// Clone ArrayList Object
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            ArrayList cloneArray = new ArrayList();
            System.Collections.ArrayList array = (System.Collections.ArrayList)base.Clone();
            for (int i = 0; i < array.Count; i++)
                cloneArray.Add(array[i]);
            return cloneArray;
        }

        #endregion
    }
}
